home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / usr / include / sys / sball.h.z / sball.h
C/C++ Source or Header  |  1992-04-03  |  2KB  |  77 lines

  1. #ifndef SB_H
  2. #define SB_H 1
  3.  
  4. #define    SB_NAME            "spaceball"
  5. #define    SB_DIAL_EMULATION_NAME    "dial+buttons"
  6. #define    SB_TYPE            "SPACEBALL"
  7. #define    SB_NUM_BUTTONS        9
  8. #define    SB_BUTTON_MASK        (0x1FF)
  9.  
  10. #define    SB_NUM_VALUATORS    7
  11. #define    SB_VALUATOR_MAX        18000
  12. #define    SB_VALUATOR_MIN        -18000
  13. #define    SB_VALUATOR_RESOLUTION        200
  14. #define    SB_VALUATOR_MIN_RESOLUTION    200
  15. #define    SB_VALUATOR_MAX_RESOLUTION    200
  16. #define    SB_VALUATOR_MASK    (0x7f)
  17.  
  18. #define    SB_NUM_BELLS        1
  19.  
  20. #define    SB_MAX_MSG_LEN        60
  21. #define    SB_MAX_VERSION_LEN    8
  22. #define    SB_MAX_DATE_LEN        12
  23.  
  24. #define    SB_NORMAL_MODE        0
  25. #define    SB_DIAL_EMULATION_MODE    1
  26.  
  27. #define    SB_NO_PERIOD        0
  28. #define    SB_GEN_PERIOD        1
  29. #define    SB_PERIOD_PREMULT    2
  30.  
  31. #ifdef _KERNEL
  32.  
  33. typedef struct sb_state {
  34.     idevInfo        info;
  35.  
  36.     unsigned        eventMode;
  37.  
  38.     idevValuatorDesc    vdesc[SB_NUM_VALUATORS];
  39.     idevTransform        vtrans[SB_NUM_VALUATORS];
  40.  
  41.     unsigned char        vactive;
  42.     int            vstate[SB_NUM_VALUATORS];
  43.  
  44.     unsigned char        bactive[idevSize(SB_NUM_BUTTONS)];
  45.     unsigned char        bstate[idevSize(SB_NUM_BUTTONS)];
  46.  
  47.     char            transMode;
  48.     char            rotMode;
  49.     char            rotForm;
  50.     char            spinExp;
  51.     char            spinMantissa;
  52.     char            pad;
  53.     char            zero[32];
  54.     int            (*parseData)(int,char *,int *,int *);
  55.     void            (*genValEvent)(struct sb_state *,int,char *);
  56.  
  57.     /* Message we are currently parsing */
  58.     char    error;    
  59.     char    msgLen;
  60.     char    msg[SB_MAX_MSG_LEN];
  61.  
  62.     char    version[SB_MAX_VERSION_LEN];
  63.     char    date[SB_MAX_DATE_LEN];
  64.     char    periodMode;
  65.  
  66.     /* Misc. Std. Driver stuff */
  67.     unsigned char initialized;/* true if data structures are set */
  68.                 /* and init sequence has been sent to */
  69.                 /* device */
  70.     unsigned char ready;    /* true if we've received confirmation */
  71.                 /* of the init sequence from the device */
  72. } sb_state_t;
  73.  
  74. #endif /* _KERNEL */
  75.  
  76. #endif
  77.